using System;
using System.Data;
using System.Collections.Generic;
using System.Collections;
using log4net;
using FSS.DAL.DBManagers;
using FSS.BLL.Entities;
namespace FSS.BLL.Services
{
	#region IVoucherOutService

	/// <summary>
	/// VoucherOutService object for Ibatis mapped table 'VoucherOut'.
	/// </summary>
	public class IVoucherOutService : BaseSqlMapDao
	{
		private static readonly ILog log = LogManager.GetLogger(typeof(IVoucherOutService).Name);
	  	
		public IList<VoucherOutEntity> LoadAll()
        {
            try
            {
                return ExecuteQueryForList< VoucherOutEntity>("VoucherOutLoadAll", null);
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                return null;
            }
        }
       public VoucherOutEntity LoadByPrimaryKey(VoucherOutEntity objE)
        {
            try
            {
                return ExecuteQueryForObject< VoucherOutEntity>("VoucherOutLoadByPrimaryKey", objE);
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                return null;
            }
        }
        
        /// <summary>
        /// add new VoucherOut to DB 
        /// </summary>
        /// <param name="objE"></param>
        /// <returns></returns>
        public int Insert(VoucherOutEntity objE)
        {
            try
            {
                ExecuteInsert("VoucherOutInsert", objE);
                return 1;
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                return 0;
            }
        }
        /// <summary>
        /// update VoucherOut to DB 
        /// </summary>
        /// <param name="objE"></param>
        /// <returns></returns>
        public int Update(VoucherOutEntity objE)
        {
            try
            {
                ExecuteUpdate("VoucherOutUpdate", objE);
                return 1;
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                return 0;
            }
        }
        /// <summary>
        /// delete VoucherOut to DB 
        /// </summary>
        /// <param name="objE"></param>
        /// <returns></returns>
        public int Delete(VoucherOutEntity objE)
        {
            try
            {
                ExecuteDelete("VoucherOutDelete", objE);
                return 1;
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                return 0;
            }
        }
	}
	#endregion  
}
